package com.sskj.mine.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonConverter;
import com.sskj.mine.bean.ClientBean;
import com.sskj.mine.bean.PageBean;
import com.sskj.mine.ui.activity.MyClientActivity;

import java.util.List;

import io.reactivex.Flowable;


public class MyClientActivityPresenter extends BasePresenter<MyClientActivity> {

    public Flowable<List<ClientBean>> getClient(int page) {
        return httpService.getClient(page)
                .converter(new JsonConverter<HttpData<PageBean<ClientBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(pageBeanHttpData -> pageBeanHttpData.getData().getList());


    }
}
